﻿namespace Ast.Core.Pe
{
    public class ImportedFunction
    {
        public ImportedFunction(int ordinal, string name, /*uint? originalThunkRva,*/uint thunkRva)
        {
            Ordinal = ordinal;
            DecoratedName = name;

            //this.OriginalThunkRva = originalThunkRva;
            ThunkRva = thunkRva;
        }

        public int Ordinal { get; private set; }

        public uint ThunkRva { get; private set; }

        public string DecoratedName { get; private set; }

//        public string UndecoratedName
//        {
//            get
//            {
//                if (this.DecoratedName == null) return null;
//                return DebugHelper.UndecorateSymbolName(this.DecoratedName);
//            }
//        } 

        //public uint? OriginalThunkRva { get; private set; }

        public override string ToString()
        {
            return DecoratedName != null
                ? string.Format("{0} @ {1}", DecoratedName, Ordinal)
                : string.Format("#{0}", Ordinal);
        }
    }
}